home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
amok
/
amok_lha
/
amok58.lha
/
crc
/
CRC.MOD
< prev
next >
Wrap
Text File
|
1993-08-15
|
3KB
|
86 lines
(* ==================================================================== *)
(* === crc.library ==================================================== *)
(* ==================================================================== *)
(*
:Program. CRC.MOD
:Contents. interface module for the crc.library
:Author. Peter Fröhlich [phf]
:Copyright. Public Domain
:Language. Oberon (revised)
:Translator. Amiga Oberon V2.01
:History. V0.2 [phf] 09-Sep-1991 [created]
:Support. -
:Imports. -
:Bugs. none known
:Address. Z-NET:P.FROEHLICH@NEXT-BOX.ZER
*)
(* ==================================================================== *)
MODULE CRC;
(* ==================================================================== *)
(* === Imports ======================================================== *)
(* ==================================================================== *)
IMPORT
e : Exec,
i : Intuition,
sys : SYSTEM;
(* ==================================================================== *)
(* === Variables ====================================================== *)
(* ==================================================================== *)
VAR
crc * : e.LibraryPtr;
(* ==================================================================== *)
(* === Procedures ===================================================== *)
(* ==================================================================== *)
(*==== Interface to the crc.library ====================================*)
(*
The following two procedures are not yet implemented... :-(
PROCEDURE UpdateCRC16 * {crc, -30} (oldCrc {0} : INTEGER;
byte {1} : BYTE) : INTEGER;
PROCEDURE CalcCRC16 * {crc, -36} (address {8} : e.ADDRESS;
initCRC {0} : INTEGER;
size {1} : INTEGER): INTEGER;
*)
PROCEDURE UpdateCRC32 * {crc, -42} (oldCrc {0} : LONGINT;
byte {1} : BYTE) : LONGINT;
PROCEDURE CalcCRC32 * {crc, -48} (address {8} : e.ADDRESS;
initCRC {0} : LONGINT;
size {1} : LONGINT): LONGINT;
(*==== Support procedures ==============================================*)
(* ==================================================================== *)
(* ==================================================================== *)
(* === Initialise ===================================================== *)
(* ==================================================================== *)
BEGIN (* CRC *)
crc := e.OpenLibrary("crc.library",0);
IF (crc = NIL) THEN
sys.SETREG(0, i.DisplayAlert(0,"\x00\x64\x14Missing crc.library !",50));
HALT(0);
END;
CLOSE
IF (crc # NIL) THEN e.CloseLibrary(crc) END;
END CRC.
(* ==================================================================== *)